package com.dy.design_pattern_study.interpreter_pattern.dome2.impl;

import com.dy.design_pattern_study.interpreter_pattern.dome2.Expression;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-24
 * @Content 音色解析器
 */
public class Scale extends Expression {
    @Override
    public void excute(String key, double value) {
        String scale = "";

        //如果获得的key 是 O 并且value是1 则演奏低音 -2中音 -3高音
        switch ((int) value) {
            case 1:
                scale = "低音";
                break;
            case 2:
                scale = "中音";
                break;
            case 3:
                scale = "高音";
                break;
        }
        System.out.println("scale = " + scale);
    }
}
